<!DOCTYPE html>
<html lang="en">
<script src="123.js"></script>
<head>
    <meta charset="UTF-8">
    <title>入门</title>
</head>
<style>
    #a{
        border: red solid 1px;
        width: 500px;
        height: 300px;
    }
    #b{
        border: blue solid 1px;
        width: 300px;
        height: 100px;
    }
</style>
<body>
  <div id="app">
        <div id="a" @mousemove="move1">
            <p id="b" @mousemove.stop="move2">
                <!--@keydown.ctrl:只有按下ctrl键时才有反应-->
                <!--@keydown.ctrl.c:只有按下ctrl+c键时才有反应-->
            </p>
        </div>
  </div>
</body>
<!--<script src="https://cdn.bootcss.com/vue/2.6.10/vue.js"></script>-->
<script>
  /*添加鼠标事件：当鼠标移动时，输出数据*/
  new Vue({
    el:"#app",   //指定我们的Vue要管理的区域 el=
    data:{//模型数据
    },
    methods:{//方法列表
        move1(event){
            console.log("div元素:"+event.x+"::"+event.y)
        },
        move2(event){
            console.log("p元素:"+event.x+"::"+event.y)
            //停止传播(停止冒泡)
            //event.stopPropagation();
        }
    }
  });
</script>
</html>